/***************************************************************************
 *            modelica.hpp
 *
 *  Sat Mar 14 21:50:13 2009
 *  Copyright  2009  Jorge Eduardo Cardona Gaviria
 *  <jorgeecardona@gmail.com>
 ****************************************************************************/

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */
 
#ifndef _MODELICA_HPP_
#define _MODELICA_HPP_


#include <gtkmm.h>
#include <iostream>
#include <string>
#include <fstream>

using namespace std;
using namespace Glib;

namespace Modelica
{

	class Prefix
	{
	public:
		Prefix():flow(false), discrete(false), parameter(false), constant(false), input(false), output(false) {std::cout << "Prefix created\n";};
	
		bool flow, discrete, parameter, constant, input, output;
	};

	class Element
	{
	public:
		Element() : is_protected(false) {};
		Element(bool r, bool f, bool i, bool o) : redeclare(r), final(f), inner(i), outer(o) {};
		Element(bool r, bool f, bool i, bool o, bool re) : redeclare(r), final(f), inner(i), outer(o), replaceable(re) {};

		bool	is_protected, redeclare, final, inner, outer, replaceable;

	};

	class Component : public Element
	{
	public:
		Component() : Element() {std::cout << "Component created\n";};
		Component(bool r, bool f, bool i, bool o) : Element(r,f,i,o) {};
		Component(bool r, bool f, bool i, bool o, bool re) : Element(r,f,i,o,re) {};

		Prefix prefix;
	};

	class Class
	{
	public:
		Class() : encapsulated(false), partial(false) {};
		Class(bool encapsulated, bool partial) : encapsulated(encapsulated), partial(partial){};

		bool			encapsulated;	///< This boolean value is true if the class is encapsulated.
		bool			partial;		///< This boolean value is true if the class is partial.
		std::string		name;			///< The name of the class.
		std::string		comment;		///< Comment of the class. This is part of the specification of the class.

		std::vector<Element*>   elements;

		/* This is necesary to keep run-time info with typeid */
		virtual void __vfunc__() {};
	};

	class Model : public Class
	{
	public:
		Model(bool e, bool p) : Class(e,p) {}
	};

	class Record : public Class
	{
	public:
		Record(bool e, bool p) : Class(e,p) {}
	};

	class Block : public Class
	{
	public:
		Block(bool e, bool p) : Class(e,p) {}
	};

	class Connector : public Class
	{
	public:
		Connector(bool e, bool p, bool expandable) : Class(e,p), expandable(expandable) {}

		bool expandable;
	};

	class Type : public Class
	{
	public:
		Type(bool e, bool p) : Class(e,p) {}
	};

	class Package : public Class
	{
	public:
		Package(bool e, bool p) : Class(e,p) {}
	};

	class Function : public Class
	{
	public:
		Function(bool e, bool p) : Class(e,p) {}
	};

	class Stored
	{
	public:
		std::string within;
		std::vector<Class*> classes;
	};


}



#endif /* _MODELICA_HPP_ */
